Also adapt the docs to not use deprecated API.
GError *error = NULL;
info = g_desktop_app_info_new ("epiphany.desktop");
- context = gdk_app_launch_context_new ();
+ context = gdk_display_get_app_launch_context (display);
g_app_info_launch (info, NULL, context, &error);
if (error)
* Use this macro to guard code that is specific to the X11-backend.
* Since GDK may be configured with multiple backends, an additional
* runtime check for the used backend is recommended:
- * </para>
+ *
* <example>
* <title>Backend-specific code</title>
* <programlisting>
* <programlisting>
* GdkAppLaunchContext *context;
*
- * context = gdk_app_launch_context_new (<!-- -->);
+ * context = gdk_display_get_app_launch_context (display);
*
- * gdk_app_launch_context_set_screen (my_screen);
+ * gdk_app_launch_context_set_screen (screen);
* gdk_app_launch_context_set_timestamp (event->time);
*
* if (!g_app_info_launch_default_for_uri ("http://www.gtk.org", context, &error))
GType gdk_app_launch_context_get_type (void);
+#ifndef GDK_DISABLE_DEPRECATED
GdkAppLaunchContext *gdk_app_launch_context_new (void);
void gdk_app_launch_context_set_display (GdkAppLaunchContext *context,
GdkDisplay *display);
+#endif
void gdk_app_launch_context_set_screen (GdkAppLaunchContext *context,
GdkScreen *screen);
void gdk_app_launch_context_set_desktop (GdkAppLaunchContext *context,
{
GdkAppLaunchContext *ctx;
- ctx = gdk_app_launch_context_new ();
- gdk_app_launch_context_set_display (ctx, display);
+ ctx = g_object_new (GDK_TYPE_APP_LAUNCH_CONTEXT,
+ "display", display,
+ NULL);
return ctx;
}
g_return_val_if_fail (uri != NULL, FALSE);
- context = gdk_app_launch_context_new ();
+ context = gdk_display_get_app_launch_context (gdk_screen_get_display (screen));
gdk_app_launch_context_set_screen (context, screen);
gdk_app_launch_context_set_timestamp (context, timestamp);